Skip to content

Add EnvSource config source and dedicated VS Code extension release#241

Merged
clavery merged 4 commits intomainfrom
feature/ext-config-source-and-ci
Mar 9, 2026
Merged

Add EnvSource config source and dedicated VS Code extension release#241
clavery merged 4 commits intomainfrom
feature/ext-config-source-and-ci

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Mar 9, 2026

Summary

  • New EnvSource config source in the SDK that maps SFCC_* environment variables to config fields, enabling the VS Code extension (and other consumers) to resolve config from .env files and env vars

  • Smart workspace folder detection in the VS Code extension — scans all workspace folders for B2C indicators (dw.json, .env with SFCC_* vars, package.json with b2c key) instead of hardcoding workspaceFolders[0]

  • .env file loading and watching in the extension — loads .env on startup and resets config when it changes

  • Dedicated VS Code extension GitHub Release — creates a separate b2c-vs-extension@X.Y.Z release (marked not-latest) with the VSIX attached, so users can easily find the latest extension without knowing which CLI release it was bundled with

  • Manual: open multi-root workspace with B2C project as non-first folder → config resolves

  • Manual: add SFCC_CLIENT_ID to .env → extension picks it up

  • CI: verify publish workflow creates dedicated extension release when extension publishes alongside other packages

clavery added 2 commits March 9, 2026 16:41
- Add EnvSource ConfigSource in SDK that maps SFCC_* env vars to
  NormalizedConfig fields (priority -10, opt-in via sourcesBefore)
- Extension now loads .env files and uses EnvSource for env var support
- Smart workspace folder detection scans for dw.json, .env with SFCC_*
  vars, and package.json b2c key in multi-root workspaces
- Add "Use as B2C Commerce Root" context menu on workspace folders to
  pin a specific folder, with "Reset to Auto-Detect" command to clear
- Pinned root persisted in workspace state, shown in status bar
- Add .env file watchers alongside existing dw.json watchers
Add a new publish.yml step that creates a separate `b2c-vs-extension@X.Y.Z`
GitHub Release with the VSIX attached, so users can easily find and download
the latest extension. The release is marked `--latest=false` to avoid
overtaking the primary npm publish releases. The step only runs when the
extension publishes alongside other packages (to avoid duplicating the
combined release when extension-only).
@clavery clavery requested a review from wei-liu-sf as a code owner March 9, 2026 21:10
@clavery clavery merged commit 3758114 into main Mar 9, 2026
5 checks passed
@clavery clavery deleted the feature/ext-config-source-and-ci branch March 9, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant